<?xml version="1.0" encoding="UTF-8"?>
<!--菜单显示【author:silver    version:1.0】-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<xsl:template match="Root">
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
				<title ReplaceLabel="1">Menu</title>
				<style type="text/css">
				td.nonsel{
					color:black;
					text-decoration:none;
				}
				td.sel{
					background-color:Navy;
					text-decoration:none;
					color:white;
				}
				</style>
				<script language="javascript" src="/safeai/script/common/tree.js">//</script>
			</head>
			<!--xsl:variable name="defaultNode" select="/*/Node[@Visible='1' and position()=1]/@ID"/-->
			<xsl:variable name="defaultNode" select="//*/Node[@Visible='1' and @Selected='1']/@ID"/>

			<body topMargin="0" leftMargin="0" rightMargin="0" bottomMargin="0" bgcolor="#DBE7F2">
				<xsl:attribute name="onload">javascript:openNode(document.getElementById('td_f<xsl:value-of select="$defaultNode"/>'));expandSelectedNode(document.getElementById('td_f<xsl:value-of select="$defaultNode"/>'));</xsl:attribute>

				<div style="OVERFLOW: auto;SCROLLBAR-HIGHLIGHT-COLOR: buttonface;SCROLLBAR-SHADOW-COLOR: buttonface;SCROLLBAR-3DLIGHT-COLOR: buttonhighlight;SCROLLBAR-TRACK-COLOR: #eeeeee;SCROLLBAR-DARKSHADOW-COLOR: buttonshadow;margin-left:-2px;height:100%;width=100%" id="top">
				<xsl:apply-templates select="Node[@Visible='1']"/>
				<form name="ready" action="" method="post" target="">
				</form>
				</div>
			</body>
		</html>
	</xsl:template>

	<!--显示树单个节点菜单-->
	<xsl:template match="Node">
		<div>
			<xsl:attribute name="id">f<xsl:value-of select="@ID"/></xsl:attribute>
			<xsl:attribute name="image"><xsl:value-of select="Image"/></xsl:attribute>
			<xsl:attribute name="imageOpen"><xsl:value-of select="ImageOpen"/></xsl:attribute>
			<xsl:attribute name="open">false</xsl:attribute>
			<!--组合URL-->
			<xsl:if test="URL">
				<xsl:attribute name="url">
					<xsl:value-of select="URL/@Value"/>?nodeId=<xsl:value-of select="@ID"/>&amp;nodeLabel=<xsl:value-of select="Label" /><xsl:for-each select="URL/Param">&amp;<xsl:value-of select="@Name"/>=<xsl:value-of select="@Value"/></xsl:for-each>
				</xsl:attribute>
				<xsl:attribute name="target">
					<xsl:value-of select="URL/@Target"/>
				</xsl:attribute>
			</xsl:if>
			<xsl:attribute name="STYLE"><xsl:choose><xsl:when test="count(ancestor::node()) > 2">display: none;</xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose>cursor: hand;</xsl:attribute>
			<table border="0" cellPadding="0" cellSpacing="0">
				<tr>
					<td height="15" valign="bottom" nowrap="nowrap" onclick="clickOnNode(document.getElementById('f{@ID}'));" onselectstart="return false" ondragstart="return false">
						<xsl:call-template name="Hierarchy" />
					</td>
					<td height="15" valign="middle" nowrap="nowrap" onclick="clickOnNode(document.getElementById('f{@ID}'));" onselectstart="return false" ondragstart="return false">
						<img border="0" width="15" height="15" id="image">
							<xsl:attribute name="SRC">
								<xsl:value-of select="Image"/>
							</xsl:attribute>
						</img>
					</td>
					<td height="15" valign="middle" nowrap="nowrap" onclick="javascript:openNode(this);">
						<xsl:attribute name="id">td_f<xsl:value-of select="@ID"/></xsl:attribute>
						<xsl:attribute name="className">nonsel</xsl:attribute>
						<xsl:attribute name="STYLE">padding-left: 7px;</xsl:attribute>
						<font name="Verdana" size="2px"><xsl:value-of select="Label" /></font>
					</td>
				</tr>
			</table>
			<xsl:apply-templates select="Children/Node[@Visible='1']" />
		</div>
	</xsl:template>

	<!--层次-->
	<xsl:template name="Hierarchy">
		<xsl:for-each select="ancestor::*[name() != Children]">
			<xsl:choose>
				<xsl:when test="following-sibling::*">
					<img border="0" width="15" height="15" src="/safeai/css/safeai/frameImg/common/I.png"/>
				</xsl:when>
				<xsl:otherwise>
					<img border="0" width="15" height="15" src="/safeai/css/safeai/frameImg/common/blank.png"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:for-each>
		<xsl:choose>
			<xsl:when test="count(Children/*) > 0">
				<xsl:choose>
					<xsl:when test="following-sibling::*">
						<img border="0" width="15" height="15" src="/safeai/css/safeai/frameImg/common/Tplus.png" _open="/safeai/images/common/Tminus.png" _closed="/safeai/images/common/Tplus.png">
							<xsl:attribute name="ID">stateImagef<xsl:value-of select="@ID"/></xsl:attribute>
						</img>
					</xsl:when>
					<xsl:otherwise>
						<img border="0" width="15" height="15" src="/safeai/css/safeai/frameImg/common/Lplus.png" _open="/safeai/images/common/Lminus.png" _closed="/safeai/images/common/Lplus.png">
							<xsl:attribute name="ID">stateImagef<xsl:value-of select="@ID"/></xsl:attribute>
						</img>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
		<xsl:otherwise>
			<xsl:choose>
				<xsl:when test="following-sibling::*">
					<img border="0" width="15" height="15" src="/safeai/css/safeai/frameImg/common/T.png"/>
				</xsl:when>
				<xsl:otherwise>
					<img border="0" width="15" height="15" src="/safeai/css/safeai/frameImg/common/L.png"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

</xsl:stylesheet>